home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / MacCleo / geoface / head.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-23  |  3.8 KB  |  102 lines

  1. typedef struct TAG {
  2.  
  3.   int poly           ;      /* an index to a tagged polygon               */
  4.   int vert           ;      /* an index to the tagged vertex              */
  5.  
  6. } TAG ;
  7.  
  8. typedef struct EXPRESSION {
  9.  
  10.   char  name[80]       ;    /* name of the expression                     */
  11.   float m[20]          ;    /* an expression vector                       */
  12.   float bias           ;    /* an bias control for the muscles            */
  13.  
  14. } EXPRESSION ;
  15.  
  16.  
  17. typedef struct MUSCLE {
  18.  
  19.   int   active         ;     /* activity switch for the muscle            */
  20.   float head[3]        ;     /* head of the muscle vector                 */
  21.   float tail[3]        ;     /* tail of the muscle vector                 */
  22.   float zone,                /* zone of influence                         */
  23.         fs, fe, mval   ;     /* zone, start, end, contraction             */
  24.   char  name[80]       ;     /* name of the muscle                        */
  25.   float clampv         ;     /* clamping value                            */
  26.   float mstat           ;     /* current contraction value                 */
  27.   
  28. } MUSCLE ;
  29.  
  30.  
  31. typedef struct  VERTEX {
  32.  
  33.   float    xyz[3]      ;     /* x,y,z of the vertex (modified)            */
  34.   float    nxyz[3]     ;     /* x,y,z of the vertex (never modified)      */
  35.   int      np          ;     /* number of polygons associated with node   */
  36.   int      plist[30]   ;     /* list of polygons associated with node     */
  37.   float    norm[3]     ;     /* polygon vertex normal                     */
  38.  
  39. } VERTEX ;
  40.  
  41.  
  42. typedef struct  POLYGON {
  43.  
  44.   VERTEX  *vertex[3]   ;     /* pointer to an array of three vertices     */
  45.  
  46. } POLYGON ;
  47.  
  48.  
  49. typedef struct  HEAD {
  50.  
  51.   int       npindices      ;  /* number of polygon indices                 */
  52.   int      *indexlist      ;  /* integer index list of size npindices*4    */
  53.  
  54.   int       npolylinenodes ;  /* number of nodes in the poly line          */
  55.   float    *polyline       ;  /* xyz nodes in the poly line                */
  56.  
  57.   int       npolygons      ;  /* total number of polygons                  */
  58.   POLYGON **polygon        ;  /* pointer to the polygon list               */
  59.  
  60.   int       neyelidtags    ;  /* number of eyelid tags                     */
  61.   TAG     **eyelidtag      ;  /* pointer to the eyelid tags                */
  62.   float     eyelidang      ;  /* rotation of the eyelids                   */
  63.  
  64.   int       njawtags       ;  /* number of jaw tags                        */
  65.   TAG     **jawtag         ;  /* pointer to the eyelid tags                */
  66.   float     jawang         ;  /* rotation of the jaw                       */
  67.  
  68.   int       nmuscles       ;  /* number of muscles in the face             */
  69.   MUSCLE  **muscle         ;  /* pointer to the muscle list                */
  70.  
  71.   int        nexpressions   ;  /* number of expressions in the           */
  72.   EXPRESSION  **expression ;  /* point to an expression vector               */
  73.  
  74. } HEAD ;
  75.  
  76. /* main.c                                */
  77. extern int verbose;
  78.  
  79. /* make_face.c                                */
  80. HEAD *create_face               ( char *, char *                   ) ;
  81. void averaged_vertex_normals     ( HEAD *face, int p, 
  82.                       float *n1, float *n2, float *n3       ) ; 
  83. void face_reset ( HEAD *face );
  84. void expressions ( HEAD *face, int e );
  85. void data_struct ( HEAD *face );
  86.  
  87. /* display.c                                */
  88. void paint_polyline         ( HEAD *face                 ) ;
  89. void paint_polygons         ( HEAD *face, int type, int normals     ) ;
  90. void calculate_polygon_vertex_normal ( HEAD *face );
  91. void paint_muscles ( HEAD *face );
  92.  
  93. /* muscle.c */
  94. void activate_muscle (HEAD *face, float *vt, float *vh, float fstart,  float fin,  float ang,  float val);
  95.  
  96. /* fileio.c */
  97. void read_polygon_indices ( char *FileName, HEAD *face );
  98. void read_polygon_line ( char    *FileName , HEAD    *face );
  99. void read_muscles ( char *FileName , HEAD *face );
  100. void read_expression_vectors ( char    *FileName , HEAD    *face );
  101.  
  102.